package org.orr.budgetpro.services;

import java.util.List;

import org.orr.budgetpro.dao.ExpenseCategoryDAO;
import org.orr.budgetpro.entities.ExpenseCategory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ExpenseCategoryService {
	@Autowired
	private ExpenseCategoryDAO expenseCategoryDAO;

	@Transactional
	public ExpenseCategory getExpenseCategory(Integer categoryId) {
		ExpenseCategory expenseCategory = expenseCategoryDAO
				.getExpenseCategory(categoryId);

		return expenseCategory;
	}

	@Transactional
	public List<ExpenseCategory> getExpenseCategories() {
		return expenseCategoryDAO.getExpenseCategories();
	}
}
